#include <iostream>

using namespace std;

/********************ZHX***************/
int factorial(int n) {
    
    std::cout<<n<<"*";
    
    if ( n == 2 ) {
      return 1;
    }

    //std::cout<<n<<"*";

    return n * factorial( n-1 );
}

int main(int argc, char const *argv[])
{
    int n = 6;
    std::cout<<n<<"! = ";
    int result = factorial(n);
    std::cout<<1;
    std::cout<<" = "<<result<<std::endl;

    //factorial(6);  
    //std::cout<<1;
    return 0;
}
/********************ZHX***************/

/********************ZZ***************
int factorial(int n) {
    if ( n == 1 ) {
        std::cout<<n;
        return 1;
    }
    
      return n * factorial( n-1 );
}

int main(int argc, char const *argv[])
{
    int n = 6;
    std::cout<<n<<"! = ";
    int result = factorial(n);
    std::cout<<" = "<<result<<std::endl;

    return 0;
}

********************ZZ***************/
